 /*
{
"状态":1,
"名称":"获取广告屏播放文件列表",
"作者":"谌舜谋",
"创建时间":"2018-10-13",
"功能":"获取广告屏播放文件列表",
"log": [
	{"date":"06-01" , "dev" :"hzhh" , "content" : ""}
]
}
*/
 
 declare @hardwareinfo varchar(100) --硬件信息
 
 set @hardwareinfo='{hardwareinfo}'
 --    869881013137826    352189076752000

 --set @hardwareinfo='S27WNXAH202255BFEBFBFF000406E3'
  
 --可以播放的文件列表
select a.entity_code,ad.ad_screen_key,img_key,oss_url,begin_time,end_time,angle
  from b_ad_imgplay  a
  inner join b_ad_img b on a.photo_album_key = b.photo_album_key
  inner join b_ad_screen ad on a.ad_screen_key = ad.ad_screen_key
   inner join b_entity_ad_screen c on a.entity_code = c.entity_code  and c.ad_screen_key  =ad.ad_screen_key
  where 1=1
		and ad.hardwareinfo = @hardwareinfo
		and ad.display_direction = b.display_direction
		and screen_ratio = ratio
		and getdate()>=begin_time
		and getdate()<=end_time 
	order by NEWID()
